package com.example.demo.entity.secondary;

import javax.persistence.Column;
import javax.persistence.Id;
import java.io.Serializable;
import java.sql.Time;

/**
 * Created by dongjunpeng on 2018/1/18.
 */
public class TallyCntrHhcEntityPK implements Serializable {
    private String shipNo;
    private String cntr;
    private String stowLoc;
    private String tallyNam;
    private Time tallyTim;

    @Column(name = "SHIP_NO")
    @Id
    public String getShipNo() {
        return shipNo;
    }

    public void setShipNo(String shipNo) {
        this.shipNo = shipNo;
    }

    @Column(name = "CNTR")
    @Id
    public String getCntr() {
        return cntr;
    }

    public void setCntr(String cntr) {
        this.cntr = cntr;
    }

    @Column(name = "STOW_LOC")
    @Id
    public String getStowLoc() {
        return stowLoc;
    }

    public void setStowLoc(String stowLoc) {
        this.stowLoc = stowLoc;
    }

    @Column(name = "TALLY_NAM")
    @Id
    public String getTallyNam() {
        return tallyNam;
    }

    public void setTallyNam(String tallyNam) {
        this.tallyNam = tallyNam;
    }

    @Column(name = "TALLY_TIM")
    @Id
    public Time getTallyTim() {
        return tallyTim;
    }

    public void setTallyTim(Time tallyTim) {
        this.tallyTim = tallyTim;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        TallyCntrHhcEntityPK that = (TallyCntrHhcEntityPK) o;

        if (shipNo != null ? !shipNo.equals(that.shipNo) : that.shipNo != null) return false;
        if (cntr != null ? !cntr.equals(that.cntr) : that.cntr != null) return false;
        if (stowLoc != null ? !stowLoc.equals(that.stowLoc) : that.stowLoc != null) return false;
        if (tallyNam != null ? !tallyNam.equals(that.tallyNam) : that.tallyNam != null) return false;
        if (tallyTim != null ? !tallyTim.equals(that.tallyTim) : that.tallyTim != null) return false;

        return true;
    }

    @Override
    public int hashCode() {
        int result = shipNo != null ? shipNo.hashCode() : 0;
        result = 31 * result + (cntr != null ? cntr.hashCode() : 0);
        result = 31 * result + (stowLoc != null ? stowLoc.hashCode() : 0);
        result = 31 * result + (tallyNam != null ? tallyNam.hashCode() : 0);
        result = 31 * result + (tallyTim != null ? tallyTim.hashCode() : 0);
        return result;
    }
}
